package com.ellricky.baselib.ui.task.beike;


import android.widget.TextView;

import com.ellricky.baselib.R;
import com.ellricky.baselib.entity.task.PreLessonDetailEntity;
import com.ellricky.baselib.http.callback.ECallback;
import com.ellricky.baselib.ui.base.BaseDetailActivity;

import static com.ellricky.baselib.http.Api.API_PRE_LESSON_DETAIL;

public class PreLessonDetailActivity extends BaseDetailActivity {

    private TextView tvContent;

    @Override
    protected int getChildContentLayout() {
        return R.layout.base_activity_pre_lesson_detail;
    }

    @Override
    public void initUIView() {
        super.initUIView();
        mTvTitle.setText(R.string.base_pre_lesson_detail);
        tvContent = findViewById(R.id.tvContent);
        loadDetailData(id);
    }


    private void loadDetailData(String id) {
        mPresenter.loadDetail(API_PRE_LESSON_DETAIL, id, new ECallback<PreLessonDetailEntity>(this) {
            @Override
            public void onSuccess(PreLessonDetailEntity data, String msg) {
                tvContent.setText(data.getCourseText());
            }
        });
    }

}
